import Vue from 'vue'
import App from './App.vue'
import router from './router'
import keepAlive from './router/keep-alive'
import store from './store'
import '@babel/polyfill' // 添加 IE 兼容
import '@styles/index.scss'
import '@plugins/element.js'
import './permission.js'
import '@components/register-global-component.js'
import api from '@api/index.js'
import Utils from '@utils/index'
import vuescroll from 'vuescroll/dist/vuescroll-native'
import VueWechatTitle from 'vue-wechat-title'
import * as filters from '@filters' // global filters
import i18n from '@plugins/i18n'
import '@styles/element-variables.scss'
import promise from 'es6-promise'

promise.polyfill()
Vue.component('myKeepAlive', keepAlive)
// 注册全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.use(vuescroll)
Vue.config.productionTip = false
// Vue.prototype.$print = print // http网络请求api
Vue.prototype.$api = api // http网络请求api

Vue.prototype.$utils = Utils // 工具函数类

Vue.use(VueWechatTitle)
const IS_PROD = ['development'].includes(process.env.NODE_ENV)
if (IS_PROD) {
  Vue.config.devtools = true
}


new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
